﻿@using Atacadao.Web.Helpers;

@model IEnumerable<Atacadao.DB.Teste>
@{
    //WebGrid grid = new WebGrid(Model, canPage: true, rowsPerPage: 5);
    Atacadao.Web.Helpers.Grid<Atacadao.DB.Teste> grid = new Atacadao.Web.Helpers.Grid<Atacadao.DB.Teste>("grdLstTeste",(IEnumerable<Atacadao.DB.Teste>)Model, (int) ViewBag.QuantidadeTotal, (int) ViewBag.PaginaAtual);
    grid.Colunas(grid.CriarColuna("Nome", "Nome"), grid.CriarColuna("Ordem", "Ordem"), grid.CriarColuna("Campo1", "Campo1"), 
    grid.CriarColuna(p => Html.ActionLink("Editar","Editar", new {id = p.CodigoTeste}).ToString(), "Editar"),
    grid.CriarColuna(p => Ajax.ActionLink("Excluir", "Excluir", new { id = p.CodigoTeste }, new AjaxOptions { Confirm = "Deseja Excluir o registro?", OnComplete = "completeExcluir", OnSuccess = "sucessExcluir", HttpMethod = "post" }, new { onclick = "excluirPost = $(this).closest(\"tr\");" }).ToString(), "Editar"));
    

     @grid.GetHtml()
    }
   